$(function(){
	var error = 'Please do not input more than 500 letters once a time!'
	$('textarea#id_content').keypress(function(){
		if($('textarea#id_content').val().length > 500 ) {
			$('input#id_submit').replaceWith("<input type='submit' id='id_submit' class='disabled' disabled=disabled value='" + error + "' />");
		} else {
			$('input#id_submit').replaceWith("<input type='submit' id='id_submit' class='button' value='Put it' />");
		}
	});
	
	$('textarea#id_content').change(function(){
		if($('textarea#id_content').val().length > 500 ) {
			$('input#id_submit').replaceWith("<input type='submit' id='id_submit' class='disabled' disabled=disabled value='" + error + "' />");
		} else {
			$('input#id_submit').replaceWith("<input type='submit' id='id_submit' class='button' value='Put it' />");
		}
	});
});